]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Restart: fix maximized windows flickering to the wrong struts
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 4 Feb 2016 18:13:13 +0000 (13:13 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 30 Jun 2016 18:17:19 +0000 (14:17 -0400)
When we restart, we need to update the struts for the screen before
we enter the main loop, or maximized windows will get resized to the
size of the screen without struts, then resized back.

A workaround is needed for a Clutter bug that occurs when we get
the size of an actor before the first paint of the stage.

https://bugzilla.gnome.org/show_bug.cgi?id=761566

js/ui/layout.js

index 7ec6867093edf060aad0e664d35e2fdaa1681203..9d481cf0b18aafc27f8c07a966ca5be8e9523280 100644 (file)
@@ -591,7 +591,10 @@ const LayoutManager = new Lang.Class({
         this.addChrome(this._coverPane);
 
         if (Meta.is_restart()) {
-            // On restart, we don't do an animation
+            // On restart, we don't do an animation. Force an update of the
+            // regions immediately so that maximized windows restore to the
+            // right size taking struts into account.
+            this._updateRegions();
         } else if (Main.sessionMode.isGreeter) {
             this.panelBox.translation_y = -this.panelBox.height;
         } else {
@@ -938,6 +941,11 @@ const LayoutManager = new Lang.Class({
         if (Main.modalCount > 0)
             return GLib.SOURCE_REMOVE;
 
+        // Bug workaround - get_transformed_position()/get_transformed_size() don't work after
+        // a change in stage size until the first pick or paint.
+        // https://bugzilla.gnome.org/show_bug.cgi?id=761565
+        global.stage.get_actor_at_pos(Clutter.PickMode.ALL, 0, 0);
+
         let rects = [], struts = [], i;
         let isPopupMenuVisible = global.top_window_group.get_children().some(isPopupMetaWindow);
         let wantsInputRegion = !isPopupMenuVisible;